package cn.wolfcode.luowowo.article.query;

import cn.wolfcode.luowowo.article.domain.Travel;
import cn.wolfcode.luowowo.common.query.QueryObject;
import lombok.Getter;
import lombok.Setter;

@Setter
@Getter
public class TravelQuery extends QueryObject{

    private int destId = -1;
    private int dayType = -1;
    private int travelTimeType = -1;
    private int perExpendType = -1;
    private int orderType = 1;  //排序 默认是最新
    private String orderBy = "t.createTime desc ";  //默认是最新

    public String getOrderBy(){
        if(orderType == 1){
            return "t.createTime desc " ;  //最新发布
        }else{
            return "t.viewnum desc";   //最热门
        }
    }
    public TravelCondition getDays(){
        return TravelCondition.dayMap.get(dayType);
    }

    public TravelCondition getTravelTime(){
        return TravelCondition.dayMap.get(travelTimeType);
    }

    public TravelCondition getPerExpend(){
        return TravelCondition.perExpendMap.get(perExpendType);
    }



}
